﻿# -*- coding:utf-8 -*-
import os
import sys
import time
import datetime
import traceback
# import smtplib
from basic.myPublic import MyFileDispose
import basic.myGlobal
from multiprocessing import Process
from basic.myRequest import MyRequest
import threading
import requests
# import tushare as ts

logger = basic.myGlobal.getLogger()
maxWaittime = 20
maxNumberTimes = 20

myFileDispose = MyFileDispose()
myLocalPath = myFileDispose.GetLocalPath()
myLocalPath = myLocalPath.replace("\\library.zip","")
logPathName = myLocalPath + "/log/"
confPathName = myLocalPath + "/conf/"
# IPCfgFileName = MyLocalPath + "/conf/IP.ini"


def myDispose(myRequest):
    u'''处理'''
    try:
        # logger.debug(" --- begin ---")

        myRequest.main()

        # logger.debug(" --- end ---")
    except:
        logger.error(traceback.format_exc())


if __name__=='__main__':
    #
    myRequest = MyRequest(myFileDispose, confPathName, logPathName)
    # p = Process(target = myTelnetDispose, args = (host, username, password, finish, commands,))
    # p.start()
    myDispose(myRequest)
    # t = threading.Thread(target = myDispose, args = (host, username, password, finish, commands,))
    # t.setDaemon(True)
    # t.start()

    # break
    # t.join()
    # time.sleep(1)
